package com.singzi.leetcode.N200;

import java.util.HashMap;
import java.util.HashSet;

public class T0136 {
}
class Solution0136 {
    public int singleNumber(int[] nums) {
        HashSet<Integer> hashSet = new HashSet<>();
        HashMap<Integer,Boolean> hashMap = new HashMap<>();
        for(Integer num:nums){
            if(hashMap.get(num)==null) hashMap.remove(num,true);
            else
                hashMap.put(num, true);
        }
        for (int key:hashMap.keySet()){
            return key;
        }
        return 0;
    }
}